#include <hxcpp.h>

#ifndef INCLUDED_JPrintStream
#include <JPrintStream.h>
#endif
#ifndef INCLUDED_Std
#include <Std.h>
#endif
#ifndef INCLUDED_cpp_CppInt32__
#include <cpp/CppInt32__.h>
#endif
#ifndef INCLUDED_haxe_io_Output
#include <haxe/io/Output.h>
#endif

Void JPrintStream_obj::__construct()
{
{
	HX_SOURCE_POS("Source/JPrintStream.hx",9)
	this->out = null();
}
;
	return null();
}

JPrintStream_obj::~JPrintStream_obj() { }

Dynamic JPrintStream_obj::__CreateEmpty() { return  new JPrintStream_obj; }
hx::ObjectPtr< JPrintStream_obj > JPrintStream_obj::__new()
{  hx::ObjectPtr< JPrintStream_obj > result = new JPrintStream_obj();
	result->__construct();
	return result;}

Dynamic JPrintStream_obj::__Create(hx::DynamicArray inArgs)
{  hx::ObjectPtr< JPrintStream_obj > result = new JPrintStream_obj();
	result->__construct();
	return result;}

Void JPrintStream_obj::append( int c){
{
		HX_SOURCE_PUSH("JPrintStream_obj::append")
		HX_SOURCE_POS("Source/JPrintStream.hx",12)
		this->out->writeString(::String::fromCharCode(c));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(JPrintStream_obj,append,(void))

Void JPrintStream_obj::print( Dynamic d){
{
		HX_SOURCE_PUSH("JPrintStream_obj::print")
		HX_SOURCE_POS("Source/JPrintStream.hx",15)
		this->out->writeString(::Std_obj::string(d));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(JPrintStream_obj,print,(void))

Void JPrintStream_obj::println( Dynamic d){
{
		HX_SOURCE_PUSH("JPrintStream_obj::println")
		HX_SOURCE_POS("Source/JPrintStream.hx",19)
		this->print(d);
		HX_SOURCE_POS("Source/JPrintStream.hx",20)
		this->print(HX_CSTRING("\n"));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(JPrintStream_obj,println,(void))

Void JPrintStream_obj::write( ::cpp::CppInt32__ b){
{
		HX_SOURCE_PUSH("JPrintStream_obj::write")
		HX_SOURCE_POS("Source/JPrintStream.hx",22)
		this->out->writeByte(::cpp::CppInt32___obj::toInt(b));
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC1(JPrintStream_obj,write,(void))

Void JPrintStream_obj::flush( ){
{
		HX_SOURCE_PUSH("JPrintStream_obj::flush")
		HX_SOURCE_POS("Source/JPrintStream.hx",25)
		this->out->flush();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(JPrintStream_obj,flush,(void))

Void JPrintStream_obj::close( ){
{
		HX_SOURCE_PUSH("JPrintStream_obj::close")
		HX_SOURCE_POS("Source/JPrintStream.hx",28)
		this->out->close();
	}
return null();
}


HX_DEFINE_DYNAMIC_FUNC0(JPrintStream_obj,close,(void))


JPrintStream_obj::JPrintStream_obj()
{
}

void JPrintStream_obj::__Mark(HX_MARK_PARAMS)
{
	HX_MARK_BEGIN_CLASS(JPrintStream);
	HX_MARK_MEMBER_NAME(out,"out");
	HX_MARK_END_CLASS();
}

void JPrintStream_obj::__Visit(HX_VISIT_PARAMS)
{
	HX_VISIT_MEMBER_NAME(out,"out");
}

Dynamic JPrintStream_obj::__Field(const ::String &inName,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"out") ) { return out; }
		break;
	case 5:
		if (HX_FIELD_EQ(inName,"print") ) { return print_dyn(); }
		if (HX_FIELD_EQ(inName,"write") ) { return write_dyn(); }
		if (HX_FIELD_EQ(inName,"flush") ) { return flush_dyn(); }
		if (HX_FIELD_EQ(inName,"close") ) { return close_dyn(); }
		break;
	case 6:
		if (HX_FIELD_EQ(inName,"append") ) { return append_dyn(); }
		break;
	case 7:
		if (HX_FIELD_EQ(inName,"println") ) { return println_dyn(); }
	}
	return super::__Field(inName,inCallProp);
}

Dynamic JPrintStream_obj::__SetField(const ::String &inName,const Dynamic &inValue,bool inCallProp)
{
	switch(inName.length) {
	case 3:
		if (HX_FIELD_EQ(inName,"out") ) { out=inValue.Cast< ::haxe::io::Output >(); return inValue; }
	}
	return super::__SetField(inName,inValue,inCallProp);
}

void JPrintStream_obj::__GetFields(Array< ::String> &outFields)
{
	outFields->push(HX_CSTRING("out"));
	super::__GetFields(outFields);
};

static ::String sStaticFields[] = {
	String(null()) };

static ::String sMemberFields[] = {
	HX_CSTRING("out"),
	HX_CSTRING("append"),
	HX_CSTRING("print"),
	HX_CSTRING("println"),
	HX_CSTRING("write"),
	HX_CSTRING("flush"),
	HX_CSTRING("close"),
	String(null()) };

static void sMarkStatics(HX_MARK_PARAMS) {
};

static void sVisitStatics(HX_VISIT_PARAMS) {
};

Class JPrintStream_obj::__mClass;

void JPrintStream_obj::__register()
{
	Static(__mClass) = hx::RegisterClass(HX_CSTRING("JPrintStream"), hx::TCanCast< JPrintStream_obj> ,sStaticFields,sMemberFields,
	&__CreateEmpty, &__Create,
	&super::__SGetClass(), 0, sMarkStatics, sVisitStatics);
}

void JPrintStream_obj::__boot()
{
}

